import request from '@/utils/request'

// 查询项目结算表列表
export function listClear(query) {
  return request({
    url: '/crm/clear/list',
    method: 'get',
    params: query
  })
}

// 查询项目结算表详细
export function getClear(id) {
  return request({
    url: '/crm/clear/' + id,
    method: 'get'
  })
}

// 新增项目结算表
export function addClear(data) {
  return request({
    url: '/crm/clear',
    method: 'post',
    data: data
  })
}

// 修改项目结算表
export function updateClear(data) {
  return request({
    url: '/crm/clear',
    method: 'put',
    data: data
  })
}

// 删除项目结算表
export function delClear(id) {
  return request({
    url: '/crm/clear/' + id,
    method: 'delete'
  })
}


// 初始化结算表
export function orderClearInit(orderId) {
  return request({
    url: '/crm/clear/orderClearInit/' + orderId,
    method: 'get'
  })
}

// 获取项目结算表详细信息
export function getInfoByOrderId(orderId) {
  return request({
    url: '/crm/clear/getInfoByOrderId/' + orderId,
    method: 'get'
  })
}

// 审核
export function audit(data) {
  return request({
    url: '/crm/clear/audit',
    method: 'post',
    data: data
  })
}
